package com.bjc.principle.observer;

/**
 * @program: DesignPattern
 * @description: 观察者模式
 * @author: bjc
 * @create: 2021-01-04 13:27
 */
public class ObserverPattern {
    public static void main(String[] args) {
        ZhangSan zhangSan = new ZhangSan();
        zhangSan.borrow(new WangWu());
        zhangSan.borrow(new LiSi());
        //state改变
        zhangSan.setState(1);
    }
}
